﻿Imports Arwani

Partial Class Backend_FileuploadManuals
    Inherits System.Web.UI.Page


    Protected Sub btnupload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnupload.Click

        Try



            If flupload.HasFile Then

                Dim filepath As String = flupload.PostedFile.FileName

                Dim ext As String = System.IO.Path.GetExtension(flupload.PostedFile.FileName)

                Dim file_ext As String = ext
                Dim filename As String = Request.QueryString("id")
                Dim file As String = filename.Replace("/", "") & file_ext
                flupload.PostedFile.SaveAs(Server.MapPath("..\Manuals\") & file)
                lblMsg.Visible = True

                Dim strQ As String
                Dim arwCon As New ArwaniController
                strQ = "update Serviceaftersale set Manuals='" & file & "' where Articleno=" & "'" & Request.QueryString("id").ToString() & "'"
                arwCon.ExecuteNonQuery(strQ)
                'Response.Write("<script>window.close()</script>")
                'Response.Redirect("ManageJobCard.aspx")

            End If

        Catch ex As Exception
            lblMsg.Text = "Some error occur."
            lblMsg.Visible = True
        End Try
    End Sub

End Class



